%7_10
%a
syms t;
s = input('请输入变量为t的函数：')
x = zeros(1,2);
s1 = diff(s);
s2 = diff(s1);
f1 = matlabFunction(s1);
f2 = matlabFunction(s2);
e = 0.0001;
i = 1;
x(1) = 3;
while(1)
    a = f1(x(i));b = f2(x(i));
    x(i+1) = x(i) - a/b;
    if abs(x(i+1) - x(i)) < abs(x(i))*e
        break;
    end
     i=i+1;
end
x
%b
format long
syms t;
s = (2*t-1).^2 + 4*(4-1024*t).^4;
s1 = diff(s);
f = matlabFunction(s1);
i = 2;
x(1) = 1;
e = 0.00001;
while(1)
   
    x(i+1) = x(i) -(f(i-1)-f(i))/(x(i-1)-x(i)) ;
    if abs(x(i+1) - x(i)) < abs(x(i))*e
        break;
    end
     i=i+1;
end
x

